﻿@using zichan.Entity.View
@using zichan.Common;
@model List<StaffRoleView>
@{
    ViewBag.Title = "职员授权管理";
}

@section Pagetitle{
    @AdminCommon.PageTitle("职员授权管理", "添加/删除授权")
}


<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-table"></i>授权列表
        </div>
        <div class="actions">
            @if (zichan.Common.PowerHelp.Check("staff", "createauth"))
            {
                <a href="@Url.Action("createauth", "staff", new { Id = ViewBag.Id })" class="btn default yellow-stripe">
                    <i class="fa fa-plus"></i>
                    <span class="hidden-480"> 添加授权</span>
                </a>
            }
        </div>
    </div>
    <div class="portlet-body">
        <div class="table-container">

            <div class="dataTables_wrapper dataTables_extended_wrapper no-footer">

                <div class="table-scrollable">
                    <table class="table  table-hover">
                        <thead>
                            <tr class="heading">
                                <th style=" width:30px;"> #</th>
                                <th>权限名称</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (StaffRoleView r in Model)
                            {
                                <tr>
                                    <td>@r.Id</td>
                                    <td>@r.RoleName</td>
                                    <td>
                                        @if (PowerHelp.Check("staff", "deleteauth"))
                                        {
                                            <a onclick="return confirm('确定删除吗？')" href="@Url.Action("deleteauth", "staff", new { staffid = r.StaffId,id=r.Id })" class="btn default btn-xs black">
                                                <i class="fa fa-trash-o"></i> 删除授权
                                            </a>
                                        }
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>

            </div>

        </div>
    </div>
</div>
